package main

import (
	"fmt"
	"github.com/ahviplc/GoJustToolc/UConsole"
	"github.com/ahviplc/GoJustToolc/UUtils/UDateTimeUtil"
	"github.com/ahviplc/GoJustToolc/UUtils/USnowFlakeUtil"
	"github.com/ahviplc/GoJustToolc/UUtils/UStringUtil"
	"github.com/gogf/gf"
	"mygogfdemo/util"
)

func main() {
	fmt.Println("hello lc this is your gogf" + gf.VERSION)
	fmt.Println("hello I am" + util.AUTHORS)

	// test GoJustToolc
	UConsole.Log(UStringUtil.ToLower("我是GoJustToolc"))
	UConsole.Log("我是GoJustToolc/UConsole")

	// test GoJustToolc v0.2.0 新增方法
	UConsole.PrintAStraightLine()
	time := UDateTimeUtil.NowDateTime()
	UConsole.Log(time)
	UConsole.PrintTypeAndValue(time)
	UConsole.PrintAStraightLine()

	// USnowFlakeUtil snowflake
	node, err := USnowFlakeUtil.NewNode(0)
	if err != nil {
		fmt.Printf("error creating NewNode, %s", err)
	}
	id := node.Generate()
	fmt.Printf("Int64    : %#v \n", id.Int64())
	fmt.Printf("String   : %#v \n", id.String())
	fmt.Printf("Base2    : %#v \n", id.Base2())
	fmt.Printf("Base32   : %#v \n", id.Base32())
	fmt.Printf("Base36   : %#v \n", id.Base36())
	fmt.Printf("Base58   : %#v \n", id.Base58())
	fmt.Printf("Base64   : %#v \n", id.Base64())
	fmt.Printf("Bytes    : %#v \n", id.Bytes())
	fmt.Printf("IntBytes : %#v \n", id.IntBytes())
	UConsole.PrintAStraightLine()
}
